<?php

class AdvController extends MController
{
	/**
	 * 广告展示
	 */
	public function actionGetadvs()
	{
		$apid = $this->getRequest('apid');
		if (!$apid) {
			$this->return_json(1, '广告位id不能为空');
		}
		$list = $this->model('ad')->getListByApId($apid);
		$result['code'] = 0;
		if (!empty($list)) {
			foreach ($list as $item) {
				$result['photojson'][] = array(
					'picurl' => AD_URL . '/' . $item['pic'],
					'objurl' => $item['url'],
					'title' => $item['title']
				);
			}
		}
		echo json_encode($result);die;
	}

	public function actionTest()
	{
		echo "adv test";die;
	}
}